package com.cpx.service;

import com.cpx.dto.PageBeanDto;
import com.cpx.po.Goods;
import com.cpx.po.GoodsBrand;
import com.cpx.po.GoodsCategory;
import com.cpx.po.GoodsSupplier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Auther: PanBin
 * @Date: 2018-11-13 17:13
 * @Description: 商品管理业务接口
 * @Version: 1.0
 */
@RequestMapping("/goods")
public interface GoodsService extends BaseService<Goods> {

    /**
     * @Author: PanBin
     * @Description: 获取商品分类的树
     * @CreateDate: 2018-11-22 17:53
     * @Param [goodsCategory]
     * @Return java.util.List<com.cpx.po.GoodsCategory>
     */
    @RequestMapping(value = "/getCategoryTree",method = RequestMethod.POST)
    List<GoodsCategory> getCategoryTree(GoodsCategory goodsCategory);

    /**
     * @Author: PanBin
     * @Description: 分配商品分类节点
     * @CreateDate: 2018-11-23 13:55
     * @Param [goodsCategory, type]
     * @Return int
     */
    @RequestMapping(value = "/updateCategoryNode",method = RequestMethod.POST)
    int updateCategoryNode(GoodsCategory goodsCategory,Integer type);

    /**
     * @Author: PanBin
     * @Description: 获取供应商列表
     * @CreateDate: 2018-11-27 10:06
     * @Param [goodsBrand]
     * @Return com.cpx.dto.PageBeanDto<com.cpx.po.GoodsBrand>
     */
    @RequestMapping(value = "/selectBrandPage",method = RequestMethod.POST)
    PageBeanDto<GoodsBrand> selectBrandPage(GoodsBrand goodsBrand,Integer pageSize,Integer pageNum);

    /**
     * @Author: PanBin
     * @Description: 添加品牌
     * @CreateDate: 2018-11-27 10:40
     * @Param [goodsBrand]
     * @Return int
     */
    @RequestMapping(value = "/addBrand",method = RequestMethod.POST)
    int addBrand(GoodsBrand goodsBrand);


    /**
     * @Author: PanBin
     * @Description: 删除品牌
     * @CreateDate: 2018-11-27 14:54
     * @Param [brandIds]
     * @Return int
     */
    @RequestMapping(value = "/delBrand",method = RequestMethod.POST)
    int delBrand(Integer[] brandIds);

    /**
     * @Author: PanBin
     * @Description: 编辑品牌
     * @CreateDate: 2018-11-27 15:52
     * @Param [goodsBrand]
     * @Return int
     */
    @RequestMapping(value = "/editBrand",method = RequestMethod.POST)
    int editBrand(GoodsBrand goodsBrand);

    /**
     * @Author: PanBin
     * @Description: 导出品牌
     * @CreateDate: 2018-11-28 10:09
     * @Param [outputStream, goodsBrand]
     * @Return void
     */
    @RequestMapping(value = "/exportBrand",method = RequestMethod.POST)
    void exportBrand(GoodsBrand goodsBrand,HttpServletResponse response) throws Exception;

    /**
     * @Author: PanBin
     * @Description: 分页获取供应商列表
     * @CreateDate: 2018-11-30 10:05
     * @Param [goodsSupplier, pageSize, pageNum]
     * @Return com.cpx.dto.PageBeanDto<com.cpx.po.GoodsSupplier>
     */
    @RequestMapping(value = "/selectSupplierPage",method = RequestMethod.POST)
    PageBeanDto<GoodsSupplier> selectSupplierPage(GoodsSupplier goodsSupplier, Integer pageSize, Integer pageNum);

    /**
     * @Author: PanBin
     * @Description: 新增供应商
     * @CreateDate: 2018-11-30 10:58
     * @Param [goodsSupplier]
     * @Return int
     */
    @RequestMapping(value = "/addSupplier",method = RequestMethod.POST)
    int addSupplier(GoodsSupplier goodsSupplier);

    /**
     * @Author: PanBin
     * @Description: 编辑供应商
     * @CreateDate: 2018-11-30 11:19
     * @Param [goodsSupplier]
     * @Return int
     */
    @RequestMapping(value = "/editSupplier",method = RequestMethod.POST)
    int editSupplier(GoodsSupplier goodsSupplier);

    /**
     * @Author: PanBin
     * @Description: 删除供应商
     * @CreateDate: 2018-11-30 13:42
     * @Param [supplierIds]
     * @Return int
     */
    @RequestMapping(value = "/delSupplier",method = RequestMethod.POST)
    int delSupplier(Integer[] supplierIds);

    /**
     * @Author: PanBin
     * @Description: 导出供应商
     * @CreateDate: 2018-11-30 13:59
     * @Param [goodsSupplier]
     * @Return feign.Response
     */
    @RequestMapping(value = "/exportSupplier")
    void exportSupplier(GoodsSupplier goodsSupplier,HttpServletResponse response) throws Exception;
}
